/****************************************************
          File Name:test.cpp
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Sun 21 Dec 2014 11:37:30 AM CST
*****************************************************/

#include<iostream>
using namespace std;        // there's a function 'max()' in this namespace

template<class T> T my_max(T a, int b)
{
    cout << "in general: " << endl;
    if(a > b)
        return a;
    else
        return b;
}

template<> float my_max(float a, int b)
{
    cout << "in specialize: " << endl;
    if(a>b) return a;
    else return b;
}

int main()
{
    int a = 1, b =2;
    float c = 3.3, d = 1.33;

   cout <<  my_max(a, b) << endl;
   cout << my_max(c,d) << endl;
   
   return 0;
}
